package com.architecture.core.entity;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: aguang
 * Date: 13-1-19
 * Time: 下午9:18
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "CORE_GROUP")
public class Group extends BaseEntity {

    @Column(name = "GROUP_TYPE")
    private int type;

    @Column(name = "GROUP_NAME")
    private String name;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "group", targetEntity = User.class, cascade = CascadeType.ALL)
    private List<User> userList;

    public List<User> getUserList() {
        return userList;
    }

    public void setUserList(List<User> userList) {
        this.userList = userList;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
